/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="voucher_template")
public class VoucherTemplate implements Serializable {
	public VoucherTemplate() {
	}
	
	private int id;
	
	private Integer userId;
	
	private String code;
	
	private String name;
	
	private String description;
	
	private String goodsBrand;
	
	private String goodsType;
	
	private String goodsClass;
	
	private java.util.Date startDate;
	
	private Integer timeLimit;
	
	private Integer limitMoney;
	
	private Integer price;
	
	private Integer giveout;
	
	private Integer total;
	
	private Integer points;
	
	private Byte state;
	
	private String goodsBrandName;
	
	private String goodsClassName;
	
	private String goodsTypeName;
	
	private java.util.Set voucher = new java.util.HashSet();
	
	public void setId(int value) {
		this.id = value;
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_VOUCHERTEMPLATE_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_VOUCHERTEMPLATE_ID_GENERATOR", strategy="identity")	
	public int getId() {
		return id;
	}
	
	@Transient	
	public int getORMID() {
		return getId();
	}
	
	/**
	 * 后台用户id
	 */
	public void setUserId(int value) {
		setUserId(new Integer(value));
	}
	
	/**
	 * 后台用户id
	 */
	public void setUserId(Integer value) {
		this.userId = value;
	}
	
	/**
	 * 后台用户id
	 */
	@Column(name="userId", nullable=true, length=10)	
	public Integer getUserId() {
		return userId;
	}
	
	/**
	 * 编码
	 */
	public void setCode(String value) {
		this.code = value;
	}
	
	/**
	 * 编码
	 */
	@Column(name="code", nullable=true, length=255)	
	public String getCode() {
		return code;
	}
	
	/**
	 * 名称
	 */
	public void setName(String value) {
		this.name = value;
	}
	
	/**
	 * 名称
	 */
	@Column(name="name", nullable=true, length=255)	
	public String getName() {
		return name;
	}
	
	/**
	 * 说明
	 */
	public void setDescription(String value) {
		this.description = value;
	}
	
	/**
	 * 说明
	 */
	@Column(name="description", nullable=true, length=255)	
	public String getDescription() {
		return description;
	}
	
	/**
	 * 使用商品品牌id逗号分隔
	 */
	public void setGoodsBrand(String value) {
		this.goodsBrand = value;
	}
	
	/**
	 * 使用商品品牌id逗号分隔
	 */
	@Column(name="goodsBrand", nullable=true, length=255)	
	public String getGoodsBrand() {
		return goodsBrand;
	}
	
	/**
	 * 使用商品类型id逗号分隔
	 */
	public void setGoodsType(String value) {
		this.goodsType = value;
	}
	
	/**
	 * 使用商品类型id逗号分隔
	 */
	@Column(name="goodsType", nullable=true, length=255)	
	public String getGoodsType() {
		return goodsType;
	}
	
	/**
	 * 使用商品类别id逗号分隔
	 */
	public void setGoodsClass(String value) {
		this.goodsClass = value;
	}
	
	/**
	 * 使用商品类别id逗号分隔
	 */
	@Column(name="goodsClass", nullable=true, length=255)	
	public String getGoodsClass() {
		return goodsClass;
	}
	
	public void setStartDate(java.util.Date value) {
		this.startDate = value;
	}
	
	@Column(name="startDate", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getStartDate() {
		return startDate;
	}
	
	/**
	 *  使用期限天
	 */
	public void setTimeLimit(int value) {
		setTimeLimit(new Integer(value));
	}
	
	/**
	 *  使用期限天
	 */
	public void setTimeLimit(Integer value) {
		this.timeLimit = value;
	}
	
	/**
	 *  使用期限天
	 */
	@Column(name="timeLimit", nullable=true, length=10)	
	public Integer getTimeLimit() {
		return timeLimit;
	}
	
	/**
	 * 订单限额
	 */
	public void setLimitMoney(int value) {
		setLimitMoney(new Integer(value));
	}
	
	/**
	 * 订单限额
	 */
	public void setLimitMoney(Integer value) {
		this.limitMoney = value;
	}
	
	/**
	 * 订单限额
	 */
	@Column(name="limitMoney", nullable=true, length=10)	
	public Integer getLimitMoney() {
		return limitMoney;
	}
	
	/**
	 * 面额
	 */
	public void setPrice(int value) {
		setPrice(new Integer(value));
	}
	
	/**
	 * 面额
	 */
	public void setPrice(Integer value) {
		this.price = value;
	}
	
	/**
	 * 面额
	 */
	@Column(name="price", nullable=true, length=10)	
	public Integer getPrice() {
		return price;
	}
	
	/**
	 * 已发放数量
	 */
	public void setGiveout(int value) {
		setGiveout(new Integer(value));
	}
	
	/**
	 * 已发放数量
	 */
	public void setGiveout(Integer value) {
		this.giveout = value;
	}
	
	/**
	 * 已发放数量
	 */
	@Column(name="giveout", nullable=true, length=10)	
	public Integer getGiveout() {
		return giveout;
	}
	
	/**
	 * 可发放总数
	 */
	public void setTotal(int value) {
		setTotal(new Integer(value));
	}
	
	/**
	 * 可发放总数
	 */
	public void setTotal(Integer value) {
		this.total = value;
	}
	
	/**
	 * 可发放总数
	 */
	@Column(name="total", nullable=true, length=10)	
	public Integer getTotal() {
		return total;
	}
	
	/**
	 * 积分兑换
	 */
	public void setPoints(int value) {
		setPoints(new Integer(value));
	}
	
	/**
	 * 积分兑换
	 */
	public void setPoints(Integer value) {
		this.points = value;
	}
	
	/**
	 * 积分兑换
	 */
	@Column(name="points", nullable=true, length=10)	
	public Integer getPoints() {
		return points;
	}
	
	/**
	 * 0无效 1有效
	 */
	public void setState(byte value) {
		setState(new Byte(value));
	}
	
	/**
	 * 0无效 1有效
	 */
	public void setState(Byte value) {
		this.state = value;
	}
	
	/**
	 * 0无效 1有效
	 */
	@Column(name="state", nullable=true)	
	public Byte getState() {
		return state;
	}
	
	public void setGoodsBrandName(String value) {
		this.goodsBrandName = value;
	}
	
	@Column(name="goodsBrandName", nullable=true, length=1000)	
	public String getGoodsBrandName() {
		return goodsBrandName;
	}
	
	public void setGoodsClassName(String value) {
		this.goodsClassName = value;
	}
	
	@Column(name="goodsClassName", nullable=true, length=1000)	
	public String getGoodsClassName() {
		return goodsClassName;
	}
	
	public void setGoodsTypeName(String value) {
		this.goodsTypeName = value;
	}
	
	@Column(name="goodsTypeName", nullable=true, length=1000)	
	public String getGoodsTypeName() {
		return goodsTypeName;
	}
	
	public void setVoucher(java.util.Set value) {
		this.voucher = value;
	}
	
	@OneToMany(mappedBy="voucherTemplate", targetEntity=cn.imvc.app.entities.Voucher.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getVoucher() {
		return voucher;
	}
	
	
	public String toString() {
		return toString(false);
	}
	
	public String toString(boolean idOnly) {
		if (idOnly) {
			return String.valueOf(getId());
		}
		else {
			StringBuffer sb = new StringBuffer();
			sb.append("VoucherTemplate[ ");
			sb.append("Id=").append(getId()).append(" ");
			sb.append("UserId=").append(getUserId()).append(" ");
			sb.append("Code=").append(getCode()).append(" ");
			sb.append("Name=").append(getName()).append(" ");
			sb.append("Description=").append(getDescription()).append(" ");
			sb.append("GoodsBrand=").append(getGoodsBrand()).append(" ");
			sb.append("GoodsType=").append(getGoodsType()).append(" ");
			sb.append("GoodsClass=").append(getGoodsClass()).append(" ");
			sb.append("StartDate=").append(getStartDate()).append(" ");
			sb.append("TimeLimit=").append(getTimeLimit()).append(" ");
			sb.append("LimitMoney=").append(getLimitMoney()).append(" ");
			sb.append("Price=").append(getPrice()).append(" ");
			sb.append("Giveout=").append(getGiveout()).append(" ");
			sb.append("Total=").append(getTotal()).append(" ");
			sb.append("Points=").append(getPoints()).append(" ");
			sb.append("State=").append(getState()).append(" ");
			sb.append("GoodsBrandName=").append(getGoodsBrandName()).append(" ");
			sb.append("GoodsClassName=").append(getGoodsClassName()).append(" ");
			sb.append("GoodsTypeName=").append(getGoodsTypeName()).append(" ");
			sb.append("Voucher.size=").append(getVoucher().size()).append(" ");
			sb.append("]");
			return sb.toString();
		}
	}
	
}
